//tag::include[]
package com.lianyou.chapter02.containerelement.nested;

//end::include[]

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

//tag::include[]
public class Car {

    private Map<@NotNull @Valid Part, List<@NotNull @Valid Manufacturer>> partManufacturers = new HashMap<>();

    //...


    public Map<Part, List<Manufacturer>> getPartManufacturers() {
        return partManufacturers;
    }

    public void setPartManufacturers(Part part, List<Manufacturer> lists) {
        this.partManufacturers.put(part,lists);
    }
}
//end::include[]
